<?php

	$logado = (AuthComponent::user('id')) ? true : false;

	if ($logado) {
		$menu = 'menu_administrador';
	} else {
		$menu = 'menu_deslogado';
	}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

    <head>

		<?php echo $this->Html->charset(); ?>

        <title>
			<?php echo 'Colégio CEI'; ?>
        </title>

        <?php
            echo $this->Html->meta('icon');
            echo $this->Html->css(array('cupertino/jquery-ui-1.8.18.custom','layout','menu','sistema','input','tabela'));
            echo $this->Html->script(array('jquery-1.7.1.min', 'jquery-ui-1.8.18.custom.min', 'jquery.cookie', 'menu/menu', 'menu/css', 'menu/jquery.hoverIntent.minified','errormessage','autofocus','oculta-flash','root'), true);
            echo $scripts_for_layout;
        ?>

	</head>

	<body>

		<div id="pagecontainer">

			<div id="pageheader">
				<span id="nome_sistema">CEI: Centro de Educação Interativa</span>
            </div>
            
            <div id="pagemenu">
				<?php echo $this->element($menu); ?>            
            </div>
            
			<div class="mensagens">
				<?php 
					$msg = $this->Session->flash();
					$auth = $this->Session->flash('auth');
					if ($msg || $auth) {
						echo $msg . ' ' . $auth;
					} 
				?>			
			</div>            

           	<div id="pagetitle">
           		<?php echo $title_for_layout ?>
			</div>
				
            <div id="pagecontent">
				<?php echo $content_for_layout; ?>
            </div>
                        			
        </div>
        
		<div id="pagefooter">
			<?php 
				if ($logado) {
					echo 'Usuário: <b>' . AuthComponent::user('nome') . '</b>';
				} 
			?>
		</div>        

    </body>
    
</html>